{{>partial_header}}

using System;
using Newtonsoft.Json;

namespace {{packageName}}.Client.Auth
{
    class TokenResponse
    {
        [JsonProperty("token_type")]
        public string TokenType { get; set; }
        [JsonProperty("access_token")]
        public string AccessToken { get; set; }
        [JsonProperty("expires_in")]
        public int? ExpiresIn { get; set; }
        [JsonProperty("created")]
        public DateTime? Created { get; set; }

        [JsonProperty("refresh_token")]
        public string{{nrt?}} RefreshToken { get; set; }

        public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value);
    }
}